package com.shanks.framework.mq.service;

import com.shanks.framework.mq.domain.MQMessage;
import com.shanks.framework.mq.exception.MQDuplicatedConsumeException;

public interface MessageConsumeService {

    /**
     * 消息是否消费
     *
     * @param message
     * @return
     */
    Boolean messageHasConsume(MQMessage message);

    /**
     * 删除消费异常记录
     *
     * @param message
     */
    void deleteConsumeException(MQMessage message);

    /**
     * 添加消费记录
     *
     * @param mqMessage
     * @param namesrvAddr
     * @param consumerName
     */
    void addConsumeRecord(MQMessage mqMessage, String namesrvAddr, String consumerName) throws Exception;

    /**
     * 添加消费异常记录
     *
     * @param mqMessage
     */
    void addConsumeExceptionRecord(MQMessage mqMessage, String consumerName) throws Exception;
}
